"""
@Desc: what are you doing
@Auth: meihongliang-m2
@Date: 2025/3/18-16:58
"""

import yfinance as yf


def main():
    # 下载股票数据
    data = yf.download("AAPL", start="2020-01-01", end="2023-01-01")
    # 查看数据
    print(data.head())


def base_info():
    ticker = yf.Ticker("AAPL")

    # 获取财务报表
    income_statement = ticker.financials  # 收入表
    balance_sheet = ticker.balance_sheet  # 资产负债表
    cash_flow = ticker.cashflow  # 现金流量表

    # 获取分红数据
    dividends = ticker.dividends
    print(dividends)

    # 获取拆股数据
    splits = ticker.splits
    print(splits)


if __name__ == '__main__':
    main()
    print('---')
    base_info()
